package com.weibo.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.weibo.entity.Xiaobian;
import com.weibo.service.XiaobianService;

public class XiaobianSaveServlet extends HttpServlet{

	public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
		doPost(request, response);
	}
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
		String xingming = request.getParameter("xingming");
		String huaming = request.getParameter("huaming");
		String shouji = request.getParameter("shouji");
		String youxiang = request.getParameter("youxiang");
		String wangwang = request.getParameter("wangwang");
		String weibo_name = request.getParameter("weibo_name");
		String des = request.getParameter("des");
		
		Xiaobian xb = new Xiaobian();
			xb.setDes(des);
			xb.setHuaming(huaming);
			xb.setShouji(shouji);
			xb.setWangwang(wangwang);
			xb.setWeibo_name(weibo_name);
			xb.setXingming(xingming);
			xb.setYouxiang(youxiang);
			
			XiaobianService xbs = new XiaobianService();
			xbs.save(xb);
			
		request.getRequestDispatcher("/xiaobian/list").forward(request, response);
		
	}

}
